<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>{$webTitle?:''}</title>
		<meta name="renderer" content="webkit">
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<link href="__LAYUI__/layui/css/layui.css" media="all" rel="stylesheet">
		<link href="__LAYUI__/adminui/dist/css/admin.css" media="all" rel="stylesheet">
	</head>
	{include file="info" /}
	<body class="layui-layout-body">
		<div id="LAY_app">
			<div class="layui-layout layui-layout-admin">

				<!-- 头部区域 -->
				<div class="layui-header">
					<ul class="layui-nav layui-layout-left">
						<li class="layui-nav-item layadmin-flexible" lay-unselect>
							<a href="javascript:;" layadmin-event="flexible" title="伸缩">
								<i class="layui-icon layui-icon-shrink-right" id="LAY_app_flexible"></i>
							</a>
						</li>
						<li class="layui-nav-item" lay-unselect>
							<a href="javascript:;" layadmin-event="refresh" title="刷新">
								<i class="layui-icon layui-icon-refresh-3"></i>
							</a>
						</li>
					</ul>
					<ul class="layui-nav layui-layout-right" lay-filter="layadmin-layout-right">
						<!-- <li class="layui-nav-item">
							<a lay-href="app/message/index.html" layadmin-event="message" lay-text="消息中心">
							  <i class="layui-icon layui-icon-notice"></i>  
							  <span class="layui-badge-dot"></span>
							</a>
						</li> -->
						<li class="layui-nav-item layui-hide-xs layui-clear">
							<a href="javascript:;" title="清理缓存">
								<i class="layui-icon layui-icon-fonts-clear"></i>
							</a>
						</li>
						<li class="layui-nav-item layui-hide-xs">
							<a href="javascript:;" layadmin-event="fullscreen" title="全屏">
								<i class="layui-icon layui-icon-screen-full"></i>
							</a>
						</li>
						<li class="layui-nav-item">
							<a lay-href="{:url('admin/myinfo')}" lay-text="个人中心" style="padding: 0;">
								<cite><em style="color:#ed1941;">{$adminName?:''}</em></cite>
							</a>
						</li>
						<li class="layui-nav-item login-out">
							<a href="javascript:;" title="退出">
								<i class="layui-icon layui-icon-logout" style="font-weight: bold;"></i>
							</a>
						</li>
					</ul>
				</div>
				<!-- 侧边菜单 -->

				<div class="layui-side layui-side-menu">
					<div class="layui-side-scroll">
						<ul class="layui-nav layui-nav-tree" lay-shrink="all" id="LAY-system-side-menu"
							lay-filter="layadmin-system-side-menu" style="margin-top: 0;">
							<!-- 这里只作三层目录 -->
							{notempty name="$menuData"}
							{volist name="menuData" id="vo"}
							{notempty name="$vo.children"}
							<li class="layui-nav-item">
								<a href="javascript:;"><i class="layui-icon {$vo.icon?:''}"></i>{$vo.title?:''}</a>
								<dl class="layui-nav-child">
									{volist name="$vo.children" id="cvo"}
									{notempty name="$cvo.children"}
									<dd><a href="javascript:;">&nbsp;&nbsp;&nbsp;&nbsp;{$cvo.title?:''}</a>
										{volist name="$cvo.children" id="ccvo"}
										<dl class="layui-nav-child">
											<dd><a lay-href="{$ccvo.href?:''}">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{$ccvo.title?:''}</a></dd>
										</dl>
										{/volist}
									</dd>
									{else/}
									<dd><a lay-href="{$cvo.href?:''}">&nbsp;&nbsp;&nbsp;&nbsp;{$cvo.title?:''}</a></dd>
									{/notempty}
									{/volist}
								</dl>
							</li>
							{else/}
							<li class="layui-nav-item"><a lay-href="{$vo.href?:''}"><i
										class="layui-icon {$vo.icon?:''}"></i>{$vo.title?:''}</a></li>
							{/notempty}
							{/volist}
							{/notempty}
						</ul>
					</div>
				</div>

				<!-- 页面标签 -->
				<div class="layadmin-pagetabs" id="LAY_app_tabs">
					<div class="layui-icon layadmin-tabs-control layui-icon-prev" layadmin-event="leftPage"></div>
					<div class="layui-icon layadmin-tabs-control layui-icon-next" layadmin-event="rightPage"></div>
					<div class="layui-icon layadmin-tabs-control layui-icon-down">
						<ul class="layui-nav layadmin-tabs-select" lay-filter="layadmin-pagetabs-nav">
							<li class="layui-nav-item" lay-unselect>
								<a href="javascript:;"></a>
								<dl class="layui-nav-child layui-anim-fadein">
									<dd layadmin-event="closeOtherTabs"><a href="javascript:;">关闭其它标签页</a></dd>
								</dl>
							</li>
						</ul>
					</div>
					<div class="layui-tab" lay-unauto lay-allowClose="true" lay-filter="layadmin-layout-tabs">
						<ul class="layui-tab-title" id="LAY_app_tabsheader">
							<li lay-id="{:url('index/welcome')}" lay-attr="{:url('index/welcome')}" class="layui-this">
								<i class="layui-icon layui-icon-home"></i></li>
						</ul>
					</div>
				</div>
				<!-- 主体内容 -->
				<div class="layui-body" id="LAY_app_body">
					<div class="layadmin-tabsbody-item layui-show">
						<iframe src="{:url('index/welcome')}" frameborder="0" class="layadmin-iframe"></iframe>
					</div>
				</div>
				<!-- 辅助元素，一般用于移动设备下遮罩 -->
				<div class="layadmin-body-shade" layadmin-event="shade"></div>
			</div>
		</div>
	</body>
</html>
<script>
	layui.use(["layer", "jquery"], function() {
		var layer = layui.layer;
		var $ = layui.jquery;
		$(".login-out").on("click", function() {
			top.layer.msg("真的要退出?", {
				icon: 3,
				time: 0,
				shade: 0.5,
				btnAlign: "c",
				btn: ["确定", "想想"],
				yes: function(index, layero) {
					$.ajax({
						url: "{:url('login/loginout')}",
						success: function(res) {
							if (res.code == 0) {
								top.notify.success(res.msg);
								setTimeout(function() {
									location.href = "/myadmin/login/index";
								}, 1000);
							} else {
								top.notify.error(res.msg);
							}
						}
					})
					return false;
				}
			})
		});
		// 清理缓存
		$(".layui-clear").on("click", function() {
			$.ajax({
				url: "{:url('index/clear')}",
				success: function(res) {
					if (res.code == 0) {
						top.notify.success(res.msg, "topRight");
					}else{
						top.notify.error(res.msg, "topRight");
					}
				}
			})
		});
		//判断用户登录是否超时 30分钟执行一次
		let sTime = setInterval(() => {
			$.ajax({
				url: "{:url('login/login_is_none')}",
				success: function(res) {
					if (res.code == 0) {
						top.notify.error(res.msg);
						setTimeout(function() {
							clearInterval(sTime);
							top.location.href = "/myadmin";
						}, 1000);
					}
				}
			})
		}, 30 * 60 * 1000);
	});
</script>